/**
 * ITranslationService.java
 *
 * Copyright (C) 2009,  Tomislav Milkovic
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */

package extjsdyntran.translation;

import java.util.Hashtable;
import java.util.Map;
import java.util.Properties;

/**
 * @description Interface for translation service  
 */
public interface ITranslationService {
	
	//set service classification, defaults to normal no editable - means no addition languages can be added
	//cannot be set from outside, abstract class will call this method from constructor 
	public ServiceTypes getServiceType();
	
	//checks for remote translation service availability
	public boolean test();
		
	//translate text to required language from default language (ENGLISH?!)
	public String translate(String text, String language);
	
	public boolean removeLanguageFromCache(String language);
	public boolean appendLanguageToCache(String language);
	public boolean appendTranslationToCache(String language, String fromValue, String toValue);
	public boolean appendTranslationToCache(String language, Properties p);
	
	//get list of languages
	public Map getListOfLanguages();

	//creates json array of translations [[ENGLISH:'...', language : '...' ]]
	public String getTranslationsToJson(String language);
	public Hashtable<String, Properties> getAllTranslations();
	public Properties getTranslations(String language);
	
	//saves languages to properties file
	public boolean saveLanguages(String language);
	// load languages from stored files
	public void loadLanguages();	
	
	public boolean saveTranslation( String toLanguage, String fromValue, String toValue);
	public boolean deleteTranslation(String fromLanguage, String fromValue);
		
	//does this service supports adding new language
	public boolean isNewLanguageSupported();
	//does this language supports requested language; null if not; ServiceTypes.NORMAL or ServiceTypes.PROXY 
	//proxy tells I am supporting translation through some other service so you need to implement returning real service if needed
	public ServiceTypes isLanguageSupported(String language);
}
